package com.isunland.managesystem.adapter;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseButterKnifeAdapter;
import com.isunland.managesystem.base.BaseVolleyActivity;
import com.isunland.managesystem.entity.StageRegisterOriginal;
import java.util.ArrayList;

/**
 * 创建者: HuXiaoDan
 * 日期: 2016/7/4 14:28
 */
public class StageRegistListAdapter
    extends BaseButterKnifeAdapter<StageRegisterOriginal.StageRegisterContent> {
  public StageRegistListAdapter(BaseVolleyActivity context,
      ArrayList<StageRegisterOriginal.StageRegisterContent> objects) {
    super(context, objects);
  }

  @Override protected int setLayoutId() {
    return R.layout.adapter_stage_list;
  }

  @NonNull @Override protected BaseViewHolder initHolder(View convertView) {
    return new ViewHolder(convertView);
  }

  @Override protected void initView(StageRegisterOriginal.StageRegisterContent item,
      BaseViewHolder baseHolder, int position) {

    ViewHolder holder = (ViewHolder) baseHolder;
    holder.tvTitleOne.setText(R.string.property);
    holder.tvTitleTwo.setText(R.string.propertyValue);
    holder.tvContentOne.setText(item.getLogName());//关键事宜
    holder.tvContentTwo.setText(item.getLogContent());//关键事宜对应内容
  }

  class ViewHolder extends BaseViewHolder {
    @BindView(R.id.tv_titleOne) TextView tvTitleOne;
    @BindView(R.id.tv_contentOne) TextView tvContentOne;
    @BindView(R.id.tv_titleTwo) TextView tvTitleTwo;
    @BindView(R.id.tv_contentTwo) TextView tvContentTwo;

    ViewHolder(View view) {
      super(view);
      ButterKnife.bind(this, view);
    }
  }
}
